package com.qs.sckill.dao;

import com.qs.sckill.entity.OrderInfo;
import org.apache.ibatis.annotations.*;

@Mapper
public interface OrderDao {

    @Insert("insert into t_order(id, user_id, goods_id, goods_name, goods_count, goods_price, order_channel, status, create_date) " +
            "values(#{id}, #{userId}, #{goodsId}, #{goodsName}, #{goodsCount}, #{goodsPrice}, #{orderChannel}, #{status}, #{createDate})")
    void insert(OrderInfo orderInfo);

    @Select("select * from t_order where id=#{orderId}")
    OrderInfo getOrderById(@Param("orderId") String orderId);

    @Delete("delete from t_order")
    void deleteAllData();
}
